package controller.command;

import javafx.scene.paint.Color;
import model.displayer.ShapeDisplayer;

public class ShapeColorChangeCmd extends CommandJFxImpl
{
    private Color oldColor,newColor;

    ShapeColorChangeCmd(ShapeDisplayer shape,Color newColor)
    {
        super(shape);
        this.oldColor = shape.getColor();
        this.newColor = newColor;
    }
    @Override
    public void execute()
    {
        shape.setColor(newColor);
    }

    @Override
    public void cancel()
    {
        shape.setColor(oldColor);
    }
}
